<template>
	<div>
		<ul class="mui-table-view">
				<li class="mui-table-view-cell mui-media"  v-for="item in list" :key = 'item.id'>
					<RouterLink :to= "'/home/newslist/newPress/'+item.id" tag ='span'>
						<img class="mui-media-object mui-pull-left" :src="item.img_url">
						<div class="mui-media-body">
							<h5 class='mui-ellipsis'>{{item.title}}</h5>
							<p>
							
							<p class="ellip">
								<span>发表时间：<span>{{item.add_time | times('YYYY-MM-DD HH-mm-ss')}}</span></span>
								<span>点击次数:<span>{{item.click}}</span><span>次</span></span>						
							</p>
							</p>
						</div>
					</RouterLink>
				</li>
			</ul>
	</div>
</template>

<script>
	import {Toast} from 'mint-ui'
	export default {
		data(){
			return {
				falg:true,
				list:[]
			}
		},
		created(){
			this.get()
		},
		methods:{
			get(){
				this.$http.get('api/getnewslist').then(
					(resolve)=>{
						
						if (resolve.body.status == 0) {
							this.list = resolve.body.message;
						} else{
							Toast('获取新闻列表失败')
						}
					
					},(reject)=>{
						Toast('网络失败')
					}
				)
			}
		},
		
	}
</script>

<style>
	.mui-table-view-cell > a:not(.mui-btn).mui-active{
		background: white!important;
	}
	.ellip{
		display: flex;
		justify-content: space-between;
		font-size: 12px;
		color: #0000FF;
	}
	.mui-h5, h5{
		color: black !important;
		margin-top: -1px;
	}
</style>
